<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2019/10/10
  Time: 14:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>用户添加</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="../css/bootstrap.min.css" rel="stylesheet" >
</head>
<body>
<ol class="breadcrumb">
    <li class="active">用户添加</li>
</ol>
<div class="container">

        <div class="form-group">
            <lable for="heroPointPrice" class="col-sm-2 control-label">ID</lable>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="ID" name="ID" placeholder="请输入ID" value="${User.id}">
            </div>
        </div>
        <div class="form-group">
            <lable for="heroName" class="col-sm-2 control-label">用户名</lable>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="userName" name="userName" placeholder="请输入用户名" value="${User.adminName}">
            </div>
        </div>
        <div class="form-group">
            <lable for="heroType" class="col-sm-2 control-label">密码</lable>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="password" name="password" placeholder="请输入密码" value="${User.password}">
            </div>
        </div>
        <div class="form-group">
            <lable for="heroPointPrice" class="col-sm-2 control-label">备注</lable>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="note" name="note" placeholder="请输入备注" value="${User.note}">
            </div>
        </div>
        <div class="form-group">
            <lable for="heroDiamondPrice" class="col-sm-2 control-label">日期</lable>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="editDate" name="editDate" placeholder="请输入日期" value="${User.editDate}">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" id="tijiao" class="btn btn-default">提交</button>
            </div>
        </div>
</div>
<script src="../js/jquery.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script charset="utf-8" type="text/javascript">
    $(function () {
        $("#tijiao").click(function () {
            $.post("../add",{
                userName:$("#userName").val(),
                password:$("#password").val(),
                ID:$("#ID").val(),
                note:$("#note").val(),
                editDate:$("#editDate").val()
            },function(data) {
                if (data=="true") {
                    window.location.href = "../right.jsp",
                    alert("添加成功")
                }else {
                    alert("用户名已存在")
                }
            })
        })
    })
</script>
</body>
</html>
